﻿@model IEnumerable<CloudFranceTriple.Models.EventSet>
@if (Model.Count() > 0)
{
    <table style="border: 1px solid #fffffe; width: 100%; margin-bottom: 10px">
        <tbody>
            <tr>
                <td colspan="6" style="padding: 10px; text-align: center; font-size: large;">
                    @Html.Raw(ViewBag.ColorCategory as String)
                </td>
            </tr>
            <tr>
                <td style="padding: 10px;">
                    <span class="display-label">
                        @CloudFranceTriple.WebRole.Properties.Resources.EventTitle
                    </span>
                </td>
                <td style="padding: 10px;">
                    <span class="display-label">
                        @CloudFranceTriple.WebRole.Properties.Resources.EventAuthor
                    </span>
                </td>
                <td style="padding: 10px;">
                    <span class="display-label">
                        @CloudFranceTriple.WebRole.Properties.Resources.EventDateStart
                    </span>
                </td>
                <td style="padding: 10px;">
                    <span class="display-label">
                        @CloudFranceTriple.WebRole.Properties.Resources.EventDateEnd
                    </span>
                </td>
                <td style="padding: 10px;">
                    <span class="display-label">
                        @CloudFranceTriple.WebRole.Properties.Resources.EventAllDay
                    </span>
                </td>
                <td></td>
            </tr>
            @foreach (var item in Model)
            {
                <tr>
                    <td style="padding: 10px;">
                        @Html.DisplayFor(modelItem => item.TitleEvent)
                    </td>
                    <td style="padding: 10px;">
                        @Html.DisplayFor(modelItem => item.AuthorEvent)
                    </td>
                    <td style="padding: 10px;">
                        @Html.DisplayFor(modelItem => item.DateStartEvent, "TemplateUserDateTime")
                    </td>
                    <td style="padding: 10px;">
                        @Html.DisplayFor(modelItem => item.DateEndEvent, "TemplateUserDateTime")
                    </td>
                    <td style="padding: 10px;">
                        @Html.DisplayFor(modelItem => item.AllDayEvent)
                    </td>
                    <td style="padding: 10px;">
                        @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonDetails, "Details", "Event", new { id = item.Id, area = "Gaming" }, null)
                        @if (User.IsInRole("RoleAdminEvent"))
                        {
                            @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonEdit, "Edit", "Event", new { id = item.Id, area = "Gaming" }, null) 
                            @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonDelete, "Delete", "Event", new { id = item.Id, area = "Gaming" }, null)
                        }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}